Skip to content

codedb-bridge: null/non-object daemon body is an isError result (#6917) - #6918

Merged
dezren39 merged 1 commit into
mainfrom
creator-b/6917-codedb-null-body
Nov 7, 2026
Merged

dezren39 merged 1 commit into
mainfrom
creator-b/6917-codedb-null-body

Conversation

@dezren39

@dezren39 dezren39 commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Fixes #6917.

bin/codedb-bridge.mjs trusted the daemon's JSON body shape after a 200 response:

  • A null body passed the data?.error check, then String(data.tree ?? '') threw a raw TypeError out of handle() for codedb_tree; main()'s dispatch catch swallowed it, so no JSON-RPC response was ever sent for that request id — the MCP client hung with no diagnostic anywhere.
  • The JSON-kind tools returned a successful result whose text was the literal string "null", presenting a daemon malfunction as an empty answer.

Fix: after the existing HTTP/error handling, a body that is null, an array, or not an object returns an isError text result naming the daemon, the route, and the unexpected shape. Well-shaped bodies, slicing, and error handling are unchanged.

Verification (laptop, this branch):

  • Probe against the fixed module: null tree body and null/string/array JSON bodies now return isError results naming the route and shape; controls (well-shaped tree, sliced search) unchanged. Pre-fix, the null tree body threw out of handle().
  • New regression test covers null tree, null search, string outline, and array hot bodies.
  • node --test bin/codedb-bridge.test.mjs — 14/14 pass.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 7, 2026 16:34
@dezren39 dezren39 added kind/bug Something isn't working (prefixed form of the classic bug label) source/creator Filed by the new-issue-creator job priority/normal Ordinary priority (the default) effort/xs Trivial: expected under 30 minutes of work app/codedb-bridge bin/codedb-bridge.mjs — stdio MCP bridge to the shared codedb daemon labels Nov 7, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T16:36:05.137227Z f619bca PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app/codedb-bridge bin/codedb-bridge.mjs — stdio MCP bridge to the shared codedb daemon effort/xs Trivial: expected under 30 minutes of work kind/bug Something isn't working (prefixed form of the classic bug label) priority/normal Ordinary priority (the default) source/creator Filed by the new-issue-creator job

Projects

None yet

1 participant